<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false" %>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>（工资查询）工资记录</title>
  <link rel="stylesheet" href="../../dist/css/layui.css">
</head>
<body>

<table id="demo" lay-filter="test"></table>

<script src="../../dist/layui.js"></script>
<script>
  layui.use(['layer', 'form'], function(){
    var layer = layui.layer
            ,form = layui.form;
  });

  layui.use('table', function(){
    var table = layui.table;

    //第一个实例
    table.render({
      elem: '#demo'
      ,height: 'full-20'
      ,url: '/student/selectSalary?type=${param.type}'  //数据接口
      ,page: {
        limit: 10,
        limits: [5, 10]
      }
      ,cols : [[ //表头
         {field: 'year', title: '学年',align: "center", width:'10%'}
        ,{field: 'term', title: '学期',align: "center", width:'10%'}
        ,{field: 'date', title: '工作月',align: "center", width:'15%'}
        ,{field: 'dept', title: '隶属部门',align: "center", width:'20%'}
        ,{field: 'name', title: '岗位名称',align: "center", width:'20%'}
        ,{field: 'salary', title: '工资',align: "center", width: '15%', sort: true}
        ,{field: 'settled', title: '是否发放',align: "center", width: '10%', templet: '#settledTpl'}
      ]]
    });
  });
</script>
<script type="text/html" id="settledTpl">
  {{#  if(d.settled == '未发放'){ }}
  <span style="color: #eb7350;">{{ d.settled }}</span>
  {{#  } else { }}
  <span style="color: mediumseagreen;">{{ d.settled }}</span>
  {{#  } }}
</script>
</body>
</html>
